{% if user.is_authenticated %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="/static/favicon.ico">
    <meta name="description" content="">
    <meta name="keyword" content="">
    <meta name="author" content="root" >
    <title>POC扫描引擎</title>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/static/style.css">
</head>
<body>
{% include 'header.html'%}
{% include 'js.html' %}
<!-- link style.css
<style>
.scan {
background-color: #FFF;
height: 60px;
width: 355px;
border: 1px solid #ddd;
margin-left: 10px;
margin-top: 10px;

}
#content {
margin:20px auto;                
}
.bg_css{
background-color: #C0C0C0 ;
}
</style>
-->

<div class="container text-center banner">

<div class="alert alert-warning" id="pocupdate" role="alert">更新了以下POC,请升级！</br>
</div>


    <!-- 扫描面板 -->
    <div class="panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title">主机端口、协议、中间件类（host）</h3>
          </div>
          <div class="panel-body" id="host">
      {% for v in data %}
        {% if v.category == 0 %}
            <div class="col-sm-12 col-md-6 col-lg-4 scan">
              <div class="content">
                <p><span><a href="{% url 'vul_scan' v.vulID %}" title="{{ v.desc }}">{{ v.name | slice:"33" }}</a><span>
                <span class="glyphicon glyphicon-ok" aria-hidden="true"><span>
                <span class="label label-danger" title="可用">{{ v.appName }}</span>       
                <span class="badge">VULID:{{ v.vulID }}</span>
                {{ v.author | slice:"7" }}
                </p>
              </div>
            </div>
        {% endif %}
      {% endfor %}  
          </div>
    </div>
    <!-- 扫描面板结束 -->


    <!-- 扫描面板 -->
    <div class="panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title">web漏洞 （HTTP）</h3>
          </div>
          <div class="panel-body" id="web">
      {% for v in data %}
        {% if v.category == 1 %}
            <div class="col-sm-12 col-md-6 col-lg-4 scan">
              <div class="content">
                <p><span><a href="{% url 'vul_scan' v.vulID %}">{{ v.name | slice:"36" }}</a><span>
                <span class="glyphicon glyphicon-ok" aria-hidden="true"><span>
                <span class="label label-danger" title="可用">{{ v.appName }}</span>       
                <span class="badge">VULID:{{ v.vulID }}</span>
                {{ v.author | slice:"7" }}
                </p>
              </div>
            </div>
        {% endif %}
      {% endfor %}  
          </div>
    </div>
    <!-- 扫描面板结束 -->




<!--
<span class="label label-danger">高危</span>
<span class="label label-warning">中危</span>
<span class="label label-info">低危</span>
<span class="label label-success">信息</span>
<span class="label label-primary">主要</span>
<span class="label label-default">轻微</span>
class="glyphicon glyphicon-ok" 可用
class="glyphicon glyphicon-remove" 不可以
-->


    <!-- 扫描面板-->
    <div class="panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title" title="没有分类的poc参考help.txt在后台修改分类">POC未分类</h3>
          </div>
          <div class="panel-body" id="unknown">  
      {% for v in data %}
        {% if v.category == NULL %}
            <div class="col-sm-12 col-md-6 col-lg-4 scan">
              <div class="content">
                <p><span><a href="{% url 'vul_scan' v.vulID %}">{{ v.name | slice:"36" }}</a><span>
                <span class="glyphicon glyphicon-ok" aria-hidden="true"><span>
                <span class="label label-danger" title="cvss3.0">{{ v.cvss }}</span>    <!-- {{ v.appName }} -->     
                <span class="badge">VULID:{{ v.vulID }}</span>
                {{ v.author | slice:"10" }}
                </p>
              </div>
            </div>
        {% endif %}
      {% endfor %}  
          </div>
    </div>
    <!-- 扫描面板结束 -->





</div>




</script>

{% include 'footer.html' %}

<script language="javascript">
$(window).load(function() {
	//默认隐藏 升级框
	$("#pocupdate").hide();
	bg_mouse();
	update()
}); 

//控制鼠标显示
function bg_mouse(){
  //当鼠标滑入时将div的class换成bg_css
  $('.scan').hover(function(){
    $(this).addClass('bg_css'); 
   },function(){
    //鼠标离开时移除divOver样式
    $(this).removeClass('bg_css');
   }
  );
}
//检测poc是否有更新
function update(){
	main_version_api = window.location.protocol + '//' + window.location.host + "{% url 'update' %}";
	//alert(main_version_api);
	$.getJSON(main_version_api, function(data){
	//alert(data);//data.name,data.vulID
		if (data != ''){
			//清空
			//$("#pocupdate").html("");//清空info内容
			//如果有更新 显示升级框
			$("#pocupdate").show();
			$.each(data,function(index,content){
			//alert(content.name);
			 $("#pocupdate").append(content.vulID+'->'+content.name+';');
			});
		}
	});
}  
</script>
<!--
  /**
  //当鼠标滑入时将div的class换成bg_css
  $('.scan').hover(function(){
    $(this).addClass('bg_css'); 
   },function(){
    //鼠标离开时移除divOver样式
    $(this).removeClass('bg_css');
   }
  );
  **/
  -->
  
<script>
/** 抛弃json 解析方式
var List = {{ list_data|safe }};
//alert(List);
var json = eval(List);
$.each( json, function(index,content){
//alert(content.fields.name);
//alert("#"+content.fields.vulType);
//alert(content.fields.name);
$("#"+content.fields.vulType).html("<div class=\"col-sm-6 col-md-4 col-lg-3 scan\"><div id=\"content\"><p><span><a href=\"#\">"+content.fields.appName+"</a><span><span class=\"glyphicon glyphicon-ok\" aria-hidden=\"true\"><span>            </div>");
});
**/
</script>


</body>
</html>
{% else %}
<script>window.location.href="{% url 'login' %}";</script> 
{% endif %}